﻿Imports System.Windows.Forms

Public Class frmPopUpCalendar

    Private _date As String

    Public Property DateReturn() As String
        Get
            If (_date Is Nothing) Then
                Return ""
            Else
                Return _date
            End If

        End Get
        Set(ByVal value As String)
            _date = value
        End Set
    End Property

    Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.DialogResult = System.Windows.Forms.DialogResult.OK
        Me.Close()
    End Sub

    Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
        Me.Close()
    End Sub

    Private Sub frmPopUpCalendar_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub MonthCalendar1_DateChanged(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DateRangeEventArgs) Handles MonthCalendar.DateChanged
        Me._date = Me.MonthCalendar.SelectionStart.ToShortDateString()
        Me.Close()
    End Sub
End Class
